package com.sansi.bleFloodlight.adapter;

import com.chad.library.adapter.base.BaseMultiItemQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.sansi.bleFloodlight.R;
import com.sansi.bleFloodlight.model.TimeModel;

import java.util.List;

public class TimeAdapter extends BaseMultiItemQuickAdapter<TimeModel, BaseViewHolder> {


    public TimeAdapter(List<TimeModel> data) {
        super(data);
        addItemType(TimeModel.NULL, TimeNotAdapter.TIMENULLLAYOUT);
        addItemType(TimeModel.NOTNULL, TimeNotNULLAdapter.TIMENOTNULLLAYOUT);
    }

    @Override
    protected void convert(final BaseViewHolder helper, TimeModel timeModel) {
        switch (helper.getItemViewType()) {
            case TimeModel.NULL:
                new TimeNotAdapter(helper, timeModel);
                break;
            case TimeModel.NOTNULL:
                new TimeNotNULLAdapter(helper, timeModel, mContext);
                break;
        }
    }
}
